package com.androidx.p013lv.mine.novel.view;

import android.text.TextUtils;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;
import android.widget.TextView;
import com.alibaba.android.arouter.launcher.ARouter;
import com.androidx.p013lv.base.Constance;
import com.androidx.p013lv.base.bean.novel.LikeNovelBean;
import com.androidx.p013lv.base.glide.GlideUtils;
import com.androidx.p013lv.base.interfaces.Key;
import com.androidx.p013lv.base.utils.SpUtils;
import com.androidx.p013lv.base.utils.UiUtils;
import com.androidx.p013lv.mine.C1207R;
import com.androidx.p013lv.mine.OnClickListenTypes;
import java.util.List;

/* renamed from: com.androidx.lv.mine.novel.view.LikeNovelTwoView */
public class LikeNovelTwoView {
    String domain;
    ImageView iv_cover;
    LinearLayout ll_item_layout;
    LinearLayout ll_label_tag;
    OnClickListenTypes onClickListenTypes;
    RelativeLayout rl_cover;
    TextView tv_favorites_num;
    TextView tv_label1;
    TextView tv_label2;
    TextView tv_label3;
    TextView tv_listen_num;
    TextView tv_title;

    public LikeNovelTwoView(View view, String str, OnClickListenTypes onClickListenTypes2) {
        this.domain = str;
        this.onClickListenTypes = onClickListenTypes2;
        this.ll_item_layout = (LinearLayout) view.findViewById(C1207R.C1210id.ll_item_layout);
        this.rl_cover = (RelativeLayout) view.findViewById(C1207R.C1210id.rl_cover);
        this.iv_cover = (ImageView) view.findViewById(C1207R.C1210id.iv_cover);
        this.tv_title = (TextView) view.findViewById(C1207R.C1210id.tv_title);
        this.ll_label_tag = (LinearLayout) view.findViewById(C1207R.C1210id.ll_label_tag);
        this.tv_label1 = (TextView) view.findViewById(C1207R.C1210id.tv_label1);
        this.tv_label2 = (TextView) view.findViewById(C1207R.C1210id.tv_label2);
        this.tv_label3 = (TextView) view.findViewById(C1207R.C1210id.tv_label3);
        this.tv_listen_num = (TextView) view.findViewById(C1207R.C1210id.tv_listen_num);
        this.tv_favorites_num = (TextView) view.findViewById(C1207R.C1210id.tv_favorites_num);
        ViewGroup.LayoutParams layoutParams = this.rl_cover.getLayoutParams();
        layoutParams.height = UiUtils.dp2px(84);
        layoutParams.width = UiUtils.dp2px(84);
        this.rl_cover.setLayoutParams(layoutParams);
    }

    public void setView(final LikeNovelBean.LikeNovelBeanData likeNovelBeanData, final int i) {
        this.tv_title.setText(likeNovelBeanData.getFictionTitle());
        TextView textView = this.tv_listen_num;
        textView.setText(UiUtils.num2str(likeNovelBeanData.getFakeWatchTimes()) + "");
        TextView textView2 = this.tv_favorites_num;
        textView2.setText(UiUtils.num2str(likeNovelBeanData.getFakeLikes()) + "");
        if (!TextUtils.isEmpty(likeNovelBeanData.getCoverImg())) {
            GlideUtils.loadCropRadiusWh2(SpUtils.getInstance().getString("domain") + likeNovelBeanData.getCoverImg(), 6, this.iv_cover, 600);
        } else {
            GlideUtils.loadCropRadiusDefault(6, this.iv_cover);
        }
        final List<LikeNovelBean.LikeNovelBeanData.TagListBean> tagList = likeNovelBeanData.getTagList();
        this.tv_label1.setVisibility(8);
        this.tv_label2.setVisibility(8);
        this.tv_label3.setVisibility(8);
        if (tagList != null && tagList.size() > 0) {
            if (tagList.get(0) != null) {
                TextView textView3 = this.tv_label1;
                textView3.setText(tagList.get(0).getTitle() + "");
                this.tv_label1.setVisibility(0);
                this.tv_label1.setOnClickListener(new View.OnClickListener() {
                    /* class com.androidx.p013lv.mine.novel.view.LikeNovelTwoView.View$OnClickListenerC13831 */

                    public void onClick(View view) {
                        ARouter.getInstance().build(Constance.VOICE_NOVEL_LABEL_ACTIVITY).withString(Key.TITLE, ((LikeNovelBean.LikeNovelBeanData.TagListBean) tagList.get(0)).getTitle()).withInt("tagId", ((LikeNovelBean.LikeNovelBeanData.TagListBean) tagList.get(0)).getTagId()).navigation();
                    }
                });
            }
            if (tagList.size() > 1 && tagList.get(1) != null) {
                TextView textView4 = this.tv_label2;
                textView4.setText(tagList.get(1).getTitle() + "");
                this.tv_label2.setVisibility(0);
                this.tv_label2.setOnClickListener(new View.OnClickListener() {
                    /* class com.androidx.p013lv.mine.novel.view.LikeNovelTwoView.View$OnClickListenerC13842 */

                    public void onClick(View view) {
                        ARouter.getInstance().build(Constance.VOICE_NOVEL_LABEL_ACTIVITY).withString(Key.TITLE, ((LikeNovelBean.LikeNovelBeanData.TagListBean) tagList.get(1)).getTitle()).withInt("tagId", ((LikeNovelBean.LikeNovelBeanData.TagListBean) tagList.get(1)).getTagId()).navigation();
                    }
                });
            }
            if (tagList.size() > 2 && tagList.get(2) != null) {
                TextView textView5 = this.tv_label3;
                textView5.setText(tagList.get(2).getTitle() + "");
                this.tv_label3.setVisibility(0);
                this.tv_label3.setOnClickListener(new View.OnClickListener() {
                    /* class com.androidx.p013lv.mine.novel.view.LikeNovelTwoView.View$OnClickListenerC13853 */

                    public void onClick(View view) {
                        ARouter.getInstance().build(Constance.VOICE_NOVEL_LABEL_ACTIVITY).withString(Key.TITLE, ((LikeNovelBean.LikeNovelBeanData.TagListBean) tagList.get(2)).getTitle()).withInt("tagId", ((LikeNovelBean.LikeNovelBeanData.TagListBean) tagList.get(2)).getTagId()).navigation();
                    }
                });
            }
        }
        this.ll_item_layout.setOnClickListener(new View.OnClickListener() {
            /* class com.androidx.p013lv.mine.novel.view.LikeNovelTwoView.View$OnClickListenerC13864 */

            public void onClick(View view) {
                LikeNovelTwoView.this.onClickListenTypes.onClick(likeNovelBeanData, i, view.getId());
            }
        });
    }
}
